怎么在<body>里加入onLoad="showimage()" 什么意思?请帮帮忙吧
来源:百度知道 编辑:UC知道 时间:2024/08/22 13:45:28
===[图片的渐显轮流播放]共3步===
这样的代码怎么用啊 都是要修改<body>标签啊
1、将以下代码加入<head></head>之间
<script language=javaScript>
<!--//
sandra0 = new Image();
sandra0.src = "images/2.jpg";
sandra1 = new Image();
sandra1.src = "images/3.jpg";
sandra2 = new Image();
sandra2.src = "images/4.jpg";
var i_strngth=1
var i_image=0
var imageurl = new Array()
imageurl[0] ="images/2.jpg"
imageurl[1] ="images/3.jpg"
imageurl[2] ="images/4.jpg"
function showimage() {
if(document.all) {
if (i_strngth <=110) {
testimage.innerHTML="<img style='filter:alpha(opacity="+i_strngth+")' src="+imageurl[i_image]+" border=0>";
i_strngth=i_strngth+10
var timer=setTimeout("showimage()",100)
}
else {
clearTimeout(timer)
var timer=setTimeout("hideimage()&qu
这样的代码怎么用啊 都是要修改<body>标签啊
1、将以下代码加入<head></head>之间
<script language=javaScript>
<!--//
sandra0 = new Image();
sandra0.src = "images/2.jpg";
sandra1 = new Image();
sandra1.src = "images/3.jpg";
sandra2 = new Image();
sandra2.src = "images/4.jpg";
var i_strngth=1
var i_image=0
var imageurl = new Array()
imageurl[0] ="images/2.jpg"
imageurl[1] ="images/3.jpg"
imageurl[2] ="images/4.jpg"
function showimage() {
if(document.all) {
if (i_strngth <=110) {
testimage.innerHTML="<img style='filter:alpha(opacity="+i_strngth+")' src="+imageurl[i_image]+" border=0>";
i_strngth=i_strngth+10
var timer=setTimeout("showimage()",100)
}
else {
clearTimeout(timer)
var timer=setTimeout("hideimage()&qu
就是调用了function showimage()的程序,showimage()它的作用就是从你准备的图片中一张一张读取images/2.jpg,images/3.jpg,images/4.jpg,每张都从透明,慢慢显现出来,再慢慢消失,依此轮回.